package ${ftl_domain_package};

import java.io.Serializable;
<#if hasDate>
import java.util.Date;
</#if>
<#if hasDecimal>
import java.math.BigDecimal;
</#if>

import javax.persistence.Entity;
import javax.persistence.Table;
<#if hasId>
import javax.persistence.Id;
</#if>
import javax.persistence.Column;
<#if hasAutoId>
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
</#if>
<#if hasDate>
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
</#if>

/**
 * Entity：${tableInfo.table_comment?if_exists} [engine:${tableInfo.engine?if_exists},type:${tableInfo.table_type?if_exists},catalog:${tableInfo.table_catalog?if_exists},schema:${tableInfo.table_schema?if_exists},name:${tableInfo.table_name?if_exists},auto:${tableInfo.auto_increment?if_exists}].
 * @author ${ftl_author}
 * @since ${ftl_now}
 * @version ${ftl_version}
 */
@Entity
@Table(name = "${tableName}")
public class ${className} implements Serializable {

    private static final long serialVersionUID = 1L;

<#list classFields as v>
    /** ${v.column_comment?if_exists}*/
    <#if v.column_key == "PRI">
    @Id
		<#if hasAutoId>
    @GeneratedValue(strategy = GenerationType.IDENTITY)
		</#if>
    </#if>
	<#if v.data_type == "timestamp" || v.data_type == "datetime">
    @Temporal(TemporalType.TIMESTAMP)
    <#elseif v.data_type == "date">
    @Temporal(TemporalType.DATE)
    <#elseif v.data_type == "time">
    @Temporal(TemporalType.TIME) 
    </#if>
    @Column(name = "${v.columnName?lower_case}")
    private ${v.type} ${v.field}<#if v.field=="fIsDeleted">= false</#if>;// ${v.column_comment?if_exists},key:${v.column_key?if_exists},null:${v.is_nullable?if_exists},type:${v.data_type?if_exists},charset:${v.character_set_name?if_exists},default: ${v.column_default?if_exists},maxLen:${v.character_maximum_length?if_exists}

</#list>
    // @Transient
    // private Object transientFiled;

    public ${className}() {}
<#list classFields as v>

    /**
     * 获取${v.column_comment?if_exists}.
     */
    public ${v.type} get${v.field?cap_first}() {
        return this.${v.field};
    }

    /**
     * 设置${v.column_comment?if_exists}.
     */
    public void set${v.field?cap_first}(${v.type} ${v.field}) {
        this.${v.field} = ${v.field};
    }
</#list>
}
